package com.bstek.bdf4.demo;


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;

import com.bstek.dorado.web.boot.DoradoApplicationInitlizalizer;
//@Import(ApplicationContextConfiguration.class)
//@EnableAutoConfiguration//(exclude = {SecurityFilterAutoConfiguration.class, SpringBootWebSecurityConfiguration.class})
@EnableWebSecurity
@SpringBootApplication
@ComponentScan(basePackages = {"com.bstek.bdf4.investigate","com.bstek.bdf4.demo"})
public class DoradoStart  extends SpringBootServletInitializer{
	
	public static void main(String[] args) throws Exception {
		SpringApplication app = new SpringApplication(DoradoStart.class);
		DoradoApplicationInitlizalizer dai = new DoradoApplicationInitlizalizer();
		dai.initSpringApplication(app);
		app.run(args);
	}

	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
		DoradoApplicationInitlizalizer dai = new DoradoApplicationInitlizalizer();
		try {
			dai.initSpringApplication(builder.application());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return builder.sources(DoradoStart.class);
	}
	
	
}